package trace

type constSampling struct {
	decision bool
}

func newConstSampler(sample float64) sampler {
	var decision bool
	if sample > 0 {
		decision = true
	}
	return &constSampling{
		decision: decision,
	}
}

//
func (p *constSampling) IsSampled(traceID uint64, operationName string) (bool, float64) {
	var param float64
	if p.decision {
		param = 1
	}
	return p.decision, param
}

//
func (p *constSampling) Close() error {
	return nil
}
